package com.idempotent.xgfidempotent.factory.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import com.idempotent.xgfidempotent.factory.IdempotentInterface;
import com.idempotent.xgfidempotent.util.RedisTokenUtils;
import com.xgf.common.xgfcommon.result.R;
@Component
public class BaseIdempotentImpl implements IdempotentInterface{
	
	@Autowired
	private RedisTokenUtils redisToken;

	@Override
	public Boolean isFit(Object retVal) {
		return retVal instanceof R;
	}

	@Override
	public void execute(Object retVal) {
		R result = (R) retVal;
		result.setToken(redisToken.getToken());
	}
	

}
